##############################################################################
#
# Library:   TubeTK
#
# Copyright 2010 Kitware Inc. 28 Corporate Drive,
# Clifton Park, NY, 12065, USA.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################

##############################################################################
# This file is automatically generated during the TubeTK configuration process.
##############################################################################

set( CTEST_CUSTOM_WARNING_MATCH
    ${CTEST_CUSTOM_WARNING_MATCH}
    "{standard input}:[0-9][0-9]*: Warning: "
    "{standard input}:[0-9][0-9]*: warning: " )

set( CTEST_CUSTOM_TESTS_IGNORE
${CTEST_CUSTOM_TESTS_IGNORE}
MinimalPathExtraction_Noise_01_NeighborhoodIterate
MinimalPathExtraction_Noise_01_GradientDescent
MinimalPathExtraction_Noise_01_RegularStepGradientDescent
MinimalPathExtraction_Synthetic_01_NeighborhoodIterate
MinimalPathExtraction_Synthetic_01_GradientDescent
MinimalPathExtraction_Synthetic_01_RegularStepGradientDescent
MinimalPathExtraction_Synthetic_02_NeighborhoodIterate
MinimalPathExtraction_Synthetic_02_GradientDescent
MinimalPathExtraction_Synthetic_02_RegularStepGradientDescent
MinimalPathExtraction_Synthetic_03_NeighborhoodIterate
MinimalPathExtraction_Synthetic_04_NeighborhoodIterate
MinimalPathExtraction_Synthetic_04_GradientDescent
MinimalPathExtraction_Synthetic_04_RegularStepGradientDescent
MinimalPathExtraction_Real_DSA_01_01_NeighborhoodIterate
MinimalPathExtraction_Real_DSA_01_01_RegularStepGradientDescent
MinimalPathExtraction_Real_DSA_01_02_NeighborhoodIterate
MinimalPathExtraction_Real_DSA_01_02_RegularStepGradientDescent )

set( CTEST_CUSTOM_COVERAGE_EXCLUDE
    # Exclude try_compile sources from coverage results:
    "/CMakeFiles/CMakeTmp/"

    # Exclude files generated by the moc pre-compiler
    ".*/moc_.*"

    # Exclude files generated by the uic pre-compiler
    ".*/ui_.*"

    # Exclude files generated by the resource pre-compiler
    ".*/qrc_.*"

    # Exclude files from the Testing directories
    ".*/CoverageInfo/.*/Testing/.*"

    # Exclude files from the Testing directories
    ".*/KWStyle/.*"

    # Exclude generated python files
    ".*Python.cxx"
    ".*PythonInit.cxx"

    # Exclude generated cpp files
    ".*/generated_cpp/.*"

    ".*CLP.h"

    ${CTEST_CUSTOM_COVERAGE_EXCLUDE} )

set( CTEST_CUSTOM_MEMCHECK_IGNORE
    # Ignore possible memory leaks in the Python interpreter.
    PrintSelf-BaseObjectDocument
    PrintSelf-BaseRegistration
    PrintSelf-BaseMetaIO
    PrintSelf-BaseNumerics
    PrintSelf-TubeTKLibCommon
    PrintSelf-TubeTKLibFiltering
    PrintSelf-TubeTKLibIO
    PrintSelf-TubeTKLibNumerics
    PrintSelf-TubeTKLibObjectDocuments
    PrintSelf-TubeTKLibRegistration
    PrintSelf-TubeTKLibSegmentation )

# GLOB automatically recurses in subdirectories.
set( CTEST_EXTRA_COVERAGE_GLOB
    */*.cxx
    */*.txx
    */*.hxx )

set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 2500 )

set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2500 )

set( CTEST_CUSTOM_ERROR_EXCEPTION
    ${CTEST_CUSTOM_ERROR_EXCEPTION}
    # Numpy errors
    "NUMPY.*Warning"
    "NUMPY._configtest.*undefined reference"
    "_configtest.*error"
    "collect2: ld returned 1 exit status" )

set( CTEST_CUSTOM_WARNING_EXCEPTION
  ${CTEST_CUSTOM_WARNING_EXCEPTION}
  "Microsoft SDKs."
  "VC.include."

  # ITK
  "itkHexahedronCell.*iteration 2"
  "itkHexahedronCell.*within this loop"

  # MacOS
  "CoreFoundation are out of sync"

  # Fake library is empty
  "itkTubeTK_fake_library_src.*empty"
  "itkTubeTK_fake_library_src.*no symbols"
  "libitkTubeTK-.*empty"

  # incrTcl
  "generic.itk_(option|archetype).*warning"
  "generic.itcl_.*warning"

  # gdcm
  "gdcm.*warning.*undefined"

  # HDF5
  "H5.*warning.*undefined"

  # jsconcpp
  "json.*reader.h.*non dll-interface.*Factor"

  # svm
  "LIBSVM.*shadows"
  "LIBSVM.*strtok"
  "LIBSVM.*strdup"
  "LIBSVM.*fscanf"
  "LIBSVM.*fopen"
  "LIBSVM.*strcpy"
  "LIBSVM.*sprintf"
  "LIBSVM.*sscanf"
  "LIBSVM.*vsprintf"
  "LIBSVM.*min.*redefinition"
  "LIBSVM.*max.*redefinition"
  "LIBSVM.*declaration is here"

  # cppcheck
  "[Cc]ppcheck.[Ll]ib"
  "[Cc]ppcheck.[Ee]xternals"
  "[Cc]ppcheck.[Cc]li"
  "[Ll]ib.[Bb]uild.mc_.*cpp.*not used"
  "[Ll]ib.[Bb]uild.mc_.*cpp.*Winline"

  # KWStyle
  "KWStyle.[Uu]tilities.[Bb]oost.[Xx]pressive"
  "KWStyle.kwStyle.cxx.*not used"
  "KWStyle.kwsStyle.cxx.*not used"
  "KWStyle.[Tt]esting"
  "detail.dynamic.sequence.hpp.*xpr.*shadows"

  # numpy - used when TubeTK is wrapped
  "Using deprecated NumPy API"

  # SlicerExecutionModel
  "GenerateCLP.cxx.*unused"
  "[Ss]licer[Ee]xecution[Mm]odel.*Module.*dll-interface"
  "[Ss]licer[Ee]xecution[Mm]odel.*Module.*conversion"
  "[Ss]licer[Ee]xecution[Mm]odel.*GenerateCLP.*conversion"

  # Slicer
  "Slicer.CMake.SlicerMacroConfigureGenericCxxModuleTests.*(if)"

  # STL - Tiger
  "include.c.*bits.stl_algo.h.*warning: comparison between signed"

  # Make
  "warning: jobserver unavailable"

  # Suppressing warnings about duplicate libraries in Darwin
  # At some point this may be addressed by CMake feature request:
  # http://public.kitware.com/Bug/view.php?id=10179
  "ld: warning: duplicate dylib"

  # Suppressing warnings about GL_GLEXT_LEGACY, the link reported below
  # report a similar problem with GL_GLEXT_PROTOTYPE.
  # http://lists.apple.com/archives/mac-opengl/2009/Dec/msg00081.html
  # That problem could be solved installing a newer version of X11 SDK
  # See http://xquartz.macosforge.org/trac/changeset/343
  ".*warning.*GL_GLEXT_LEGACY.*redefined"

  # ITK suppressions
  #"[Uu]tilities.gdcm"
  #"[Uu]tilities.vxl"
  #"[Uu]tilities.itktiff"
  #"[Cc]ore.[Cc]ommon.[Ii]nclude.itkImageRegionConstIteratorWithIndex.hxx.*assuming signed overflow does not occur"
  #"SetRotationMatrix.*deprecated"
  #"KWSys.*SharedForward.*_snprintf"
  #"KWSys.*SharedForward.*strcpy"
  #"KWSys.*SharedForward.*strncpy"
  #"KWSys.*SharedForward.*strcat"
  #"KWSys.*SharedForward.*putenv"
  #"KWSys.*SharedForward.*getenv"
  #"[Mm]odules.[Ff]iltering.[Ff]ast[Mm]arching"
  #"[Mm]odules.[Rr]emote.[Mm]inimal[Pp]ath[Ee]xtraction"
  #"[Mm]odules.*unary minus operator applied to unsigned"
  #"libpcre.*has no symbols"
  #"current project.*configured.*standard version older"
  ## MacOS 10.12 deprecations
  #"OSMemory.*deprecated"
  #"OSAtomic.*deprecated"

  # VTK suppressions
  #"vtkfreetype"
  #"Utilities.vtktiff"
  #"VTK.*IO.vtkMySQLQuery.cxx"
  #"VTK.*Utilities.vtkexodus2"
  #"VTK.*Utilities.vtklibproj"
  #"VTK.*Utilities.vtksqlite"
  #"VTK.*Utilities.VPIC.*cxx"
  #"VTK.*warn_unused_result"
  #"VTK.*Filtering.*cxx"
  #"VTK.*IO.*cxx"
  #"VTK.*Infovis.*cxx"
  ## exception specific to Mac/Carbon
  #"VTK.Rendering.vtkCarbonRenderWindow.*warning.*(NewRgn|DiffRgn|EqualRgn|DisposeRgn).*is deprecated"
  # exception specific to Mac/X11
  #"VTK.Rendering.vtkOpenGL.*warning: this is the location of the previous definition"

  # Visual studio spurious warnings...
  "The following environment variables were not found"

  # Git
  "HEAD is now"

  # Gcc
  "unrecognized command line option.*no-unused-local-typedefs"
  )
